// app/src/main/java/com/example/memoapp/models/Post.java
package com.example.memoapp.models;

import java.io.Serializable;

public class Post implements Serializable {
    private int id;
    private String title;
    private String content;
    private String author;
    private long timestamp;

    //
    public Post() {}

    public Post(String title, String content, String author) {
        this.title = title;
        this.content = content;
        this.author = author;
        this.timestamp = System.currentTimeMillis();
    }

    // Getters and Setters
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    // 格式化时间戳为可读日期
    public String getFormattedDate() {
        // 这里可以实现日期格式化逻辑
        return String.valueOf(timestamp);
    }
}